/*定义一个算式类的构造方法
 op随机值：+，-，+(,-(,*/
	var ops=['+','-','(','*','/','%',')']
function Equation(low,high) {    //构造函数模式
	this.n1 = RNDN(low,high);
    this.n2 = RNDN(low,high);
    this.n3 = RNDN(low,high);
    this.op1=ops[RNDN(0,3)];
    this.op2=ops[RNDN(0,1)];
    
　　this.goString = function(){
　　　　 if(this.op1=='*')
        {
           this.n1=this.n1%10;
           this.n2=this.n2%10;
          }
        if(this.op1=='(')
           this.E1=this.op1+this.n1 +ops[this.n2%2]+this.n2+ops[6];
         else
           this.E1=this.n1+this.op1+this.n2;
        
        if((this.n1+this.n2)%2==1)
          return this.E1+this.op2+this.n3;
        else
          return this.n3+this.op2+this.E1;

　　};
this.answer=function(){
    	   eval(this.goString());
   };
}
function RNDN(low,high){
	return parseInt(Math.random()*(high-low+1)+low); 
}